package cn.hennancf.qieqie.http;


import cn.hennancf.qieqie.utils.http.HttpSendResult;
import cn.hennancf.qieqie.utils.http.HttpsPost;
import com.alibaba.fastjson.JSON;
import com.google.common.collect.Maps;

import java.util.Map;

/**
 * Created: 下午6:26-2018/8/9
 * author: feiFei.chen
 * desc: TODO Something
 * version: 1.0
 */
public class MainTest {


    public static void main(String[] args){
        Map<String, String> header = Maps.newHashMap();
        String url = "http://b6.bachman.wormpex.com/bach/finance/contract/base/list/without/auth?_time=1533873506223";
        Map<String, Object> params = Maps.newHashMap();
        int timeout = 10000;



        Map<String, Object> values = Maps.newHashMap();


        values.put("pageNo",1);
        values.put("pageSize",20);

        params.put("page",values);
        header.put("Accept", "*/*");
        header.put("Accept-Encoding", "gzip, deflate");
        header.put("Accept-Language", "zh-CN,zh;q=0.9");
        header.put("Connection", "keep-alive");
        header.put("Content-Type", "application/json;charset=UTF-8");
//		httpPost.addHeader("Content-Length", "124");
        header.put("Cookie", "isGray=false; OUTFOX_SEARCH_USER_ID_NCOO=1674621200.6852825; operator_ticket=416869d927f14a31924c9be5e710f0de; operator_sign=bb0942470c823cee2b93a8646429d65f; operator_timestamp=1533869071849; user_name=zhishuai.zhou; operator_ticket=416869d927f14a31924c9be5e710f0de; operator_sign=06ffdc5058fb47bb01f1ad6f2664c462; operator_timestamp=1533869082189; user_name=zhishuai.zhou");
        header.put("device", "0");


        header.put("Host", "b6.bachman.wormpex.com");
        header.put("Origin", "http://b6.bachman.wormpex.com");
        header.put("Referer", "http://b6.bachman.wormpex.com/bach-erp/web/ContractManager/AnnualContractView");


        header.put("User-Agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.84 Safari/537.3");

        HttpSendResult result = HttpsPost.postJsonParam(url, params, timeout, header);

        System.out.println(JSON.toJSON(result));
    }
}
